<?php
namespace Admin\Model;

class GoodsCateModel extends CommonModel{

	public function insertExtCate($goods_id,$cate_id){
		//将商品的扩展分类写入数据库
		//去重操作 cate_ext[1=>'',2=>'']
		$cate_id = array_unique($cate_id);
		foreach ($cate_id as $key => $value) {
			if($value<>0){
				//要插入的数据
				$list[] = ["goods_id"=>$goods_id,"cate_id"=>$value];
			}
		}
		$this->addAll($list);
	}
}